const meModule = {
    namespaced:true,
    state:{
        money:0,
        popupState:false,
        paid:[],
        putAway:[],
        toBePaid:[]
    },
    getters:{
        getMoney(_state){
            return _state.money
        },
        getPopupState(_state){
            return _state.popupState
        },
        getPutAway(_state){
            return _state.putAway
        },
        getToBePaid(_state){
            return _state.toBePaid
        }
    },
    mutations:{
        changeMoney(_state,val){
           return _state.money = val
        },
        changePopupState(_state,val){
            return _state.popupState = val
        },
        //添加余额
        addMoney(_state,val){
            return _state.money =_state.money *1 + val * 1
        },
        //减少余额
        subMoney(_state,val){
            return _state.money = _state.money*1 - val * 1
        },
        addPaid(_state,val){
            return _state.paid.unshift(val)
        },
        //待收货
        changePutAway(_state,val){
            return _state.putAway.push(val)
        },
        //待支付
        changeToBePaid(_state,val){
            return _state.toBePaid.push(val)
        }
    }
}

export default meModule